define(function() {
	function maxNum(num, max, str) {
		if (num < 0) {
			alert("金额非法:不能为负");
			return false;
		}
		if (num > max) {
			alert("超过" + str + '最大限制')
			return false;
		}
		return true
	}

	function legalNum(num, str) {
		// var reg = new RegExp("^\+?[1-9][0-9]*$ ");  
		var reg = new RegExp("^[0-9]*$");  

		if (!reg.test(num)) {
			alert("金额非法");
			return false;
		}
		return true
	}

	function isNull(obj, str) {
		console.log(obj);
		if (obj == "" || obj == undefined) {
			alert(str + "不得为空");
			return false;
		} else {
			return true
		}
	}
	return {
		maxNum,
		isNull,
		legalNum
	};
});